﻿using IR.Common.Utilities;
using IR.Controller.ModelControllers;
using IR.WPF.UI.ViewModels;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using IR.Controller.ModelControllers;

namespace IR
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window, INotifyPropertyChanged
    {
        private CUser _loggedInUser;
        private VMVersion _currentlySelectedVersion;
        private VMIdea _currentlySelectedIdea;
        private VMUser _currentlySelectedUser;

        public event PropertyChangedEventHandler PropertyChanged;

        public MainWindow()
        {
            InitializeComponent();
        }

        #region **Properties**
        public CUser LoggedInUser
        {
            get { return _loggedInUser; }
            set
            {
                _loggedInUser = value;
                OnPropertyChanged("LoggedInUser");
            }
        }

        public VMVersion CurrentlySelectedVersion
        {
            get { return _currentlySelectedVersion; }
            set
            {
                _currentlySelectedVersion = value;
                OnPropertyChanged("CurrentlySelectedVersion");
            }
        }

        public VMIdea CurrentlySelectedIdea
        {
            get { return _currentlySelectedIdea; }
            set
            {
                _currentlySelectedIdea = value;
                OnPropertyChanged("CurrentlySelectedIdea");
            }
        }

        public VMUser CurrentlySelectedUser
        {
            get { return _currentlySelectedUser; }
            set
            {
                _currentlySelectedUser = value;
                OnPropertyChanged("CurrentlySelectedUser");
            }
        }
        #endregion

        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
    }
}
